home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_i_l / incx101b.zip / INC-PROG.LZH / HELP.LZH / MU.HLP < prev   
Text File  |  1991-07-17  |  23KB  |  507 lines

  1. mu
  2.  Help information about: Usage Examples and Suggestions
  3.  Examples: ^A ^B ^C ^D ^E
  4.  
  5.               E╔════════════════════════════════════════════════╗
  6.               E║      CUsage Examples and Application NotesE      ║
  7.               E╚════════════════════════════════════════════════╝
  8.  
  9.  
  10.    For additional information about ways of using InContext, the user can
  11.    consult two sources.  CUsage ExamplesB are found here in the help system.
  12.    Studying these examples will help you pick up ideas and will increase your
  13.    understanding.  A usage example describes a particular approach to
  14.    organizing a portion of your computer-based work environment.  One or
  15.    more ways of achieving this organization are then described, typically
  16.    ranging from a very simple implementation to a more sophisticated one.
  17.  
  18.    Both Usage Examples and Application Notes are constantly being added and
  19.    updated.  Registered users can obtain a full, current set from the Rams
  20.    Island BBS.
  21.  
  22.  CApplication Notes
  23.  
  24.    CApplication NotesB ("CAppNotesB") have a different purpose, though they can
  25.    also be a useful source of understanding and examples.  Application notes
  26.    help you incorporate other programs into your work environment.  Some of
  27.    these programs may be used as tools (a viewer, print utility, or
  28.    whatever), while others may represent the applications that you use to do
  29.    your actual work (word processors or spreadsheet programs, for example).
  30.    A starter set of application notes comes with the shareware version of
  31.    InContext.  Additional "AppNotes" are available to registered users,
  32.    through our BBS or by mail.
  33.  
  34.    The starter AppNotes are found in the "APPNOTES.LZH" archive in the
  35.    InContext directory.  This is an archive containing a collection of
  36.    "app" files.  The "app" files are themselves archives, which must be
  37.    extracted before you can make use of them.  To examine one, you should
  38.    first "Edit" the APPNOTES.LZH file.  Select the AppNote you're interested
  39.    in, and extract it.  Then exit the editor.  You will find that the
  40.    extracted "app" object can be selected and edited.  You will find a text
  41.    file ("txt" class) to read, and perhaps an action definition or template,
  42.    if those are relevant.
  43.  
  44.  CAvailable Usage Examples
  45.  
  46.  ZmuaB       CJ Example A -- External Editors and Viewers CB.
  47.  
  48.  ZmubB       CJ Example B -- Document Archive CB.
  49.  
  50.  ZmucB       CJ Example C -- Phone List CB.
  51.  
  52.  ZmudB       CJ Example D -- Object Deletion CB.
  53.  
  54.  ZmueB       CJ Example E -- Installing a Print Spooler CB.
  55. mua
  56.  Usage Example A: External Editors and Viewers
  57.  
  58.  
  59.               E╔════════════════════════════════════════════════╗
  60.               E║ CUsage Example A: External Editors and ViewersE  ║
  61.               E╚════════════════════════════════════════════════╝
  62.  
  63.  
  64.    InContext has its own internal text editor and text/hexadecimal viewer.
  65.    These are provided for two reasons:
  66.  
  67.       CB  Some users may not have their own editor or viewer, and they
  68.          would be unable to make effective use of InContext without them.
  69.  
  70.       CB  Some users may prefer to use the internal editor and viewer
  71.          because they are much faster to invoke than external programs.
  72.  
  73.    However, the internal editor and viewer are clearly much simpler than
  74.    other text editors and viewers the user might have access to, and most
  75.    users will prefer to use external editors and viewers.  The procedure
  76.    for substituting your own preferred tools is fairly simple.
  77.  
  78.  CSubstituting an External Editor
  79.  
  80.    To substitute a different editor ("myeditor", as an example):
  81.  
  82.       CB  Change the definition of the "editText" macro from "!edit %f"
  83.          to "myeditor %f" (or whatever similar command is used to invoke your
  84.          editor in the preferred way).  This change will cause your editor to
  85.          be invoked whenever the "edit" action from the "Common" action list
  86.          is selected.
  87.  
  88.       CB  Change the definition of the "edit-all" action from the "Group"
  89.          action list.  This will allow use of your editor on a group of
  90.          objects.  You probably will want to do this only if your editor
  91.          behaves acceptably if it is accidentally invoked on a non-text file.
  92.          You will especially want to do this if your editor can be invoked
  93.          on multiple files.
  94.  
  95.          If your editor can handle multiple files, then replace the entire
  96.          "edit-all" procedure with "myeditor %m" (or whatever similar command
  97.          is used to invoke your editor in the preferred way).
  98.  
  99.          If your editor cannot handle multiple files, then replace only the
  100.          "!edit %F" command with "myeditor %F" (or something similar).
  101.  
  102.    If you prefer to substitute your editor only for large files, and use the
  103.  ZmcaemB  internal editor for small files, change the CJ incEdit macro CB instead.
  104.  
  105.  CSubstituting an External Viewer
  106.  
  107.    To substitute a different viewer ("list", for example):
  108.  
  109.       CB  Change the definition of the "viewText" macro from "!view %f"
  110.          to "list %f" (or whatever similar command is used to invoke your
  111.          viewer in the preferred way).  This change will cause your viewer to
  112.          be invoked whenever the "view" action from the "Common" action list
  113.          is selected.
  114.  
  115.       CB  Change the definition of the "view-all" action from the "Group"
  116.          action list.  This will allow use of your viewer on a group of
  117.          objects.  You will especially want to do this if your viewer can be
  118.          invoked on multiple files.
  119.  
  120.          If your viewer can handle multiple files, then replace the entire
  121.          "view-all" procedure with "list %m" (or whatever similar command
  122.          is used to invoke your viewer in the preferred way).
  123.  
  124.          If your viewer cannot handle multiple files, then replace only the
  125.          "!view %F" command with "list %F" (or something similar).
  126.  
  127.  CMore Complex Editor Procedures
  128.  
  129.    You may have occasion to define a more complex procedure for invoking your
  130.    editor.  Consider, for example, the following procedure:
  131.  
  132.         menu c:\tools\brief.mnu
  133.         b -u150 -L%l %f
  134.         menu off
  135.         !relogDir c:\brief\backup
  136.  
  137.    This procedure invokes the Brief editor ("b").  Because Brief supports
  138.    variable screen sizes, this procedure makes use of its -L argument to
  139.    specify the current number of display lines.
  140.  
  141.    Before Brief is invoked, though, the procedure invokes the Microsoft Mouse
  142.    Menu program using a mouse menu definition defined for that editor.  The
  143.    Mouse Menu program is a TSR (Terminate-and-Stay-Resident) program that
  144.    allows the use of a mouse with programs not designed to support a mouse.
  145.    This program remains resident in memory while Brief is executing, and is
  146.    then unloaded from memory.  Because Brief saves backup copies in the
  147.    directory C:\BRIEF\BACKUP, that directory is relogged each time Brief is
  148.    invoked.  That causes InContext to have a current log for the files that
  149.    are backed up in this way.
  150.  
  151.    A comment on TSR's is in order (for advanced users).  Notice that, in the
  152.    above procedure, a TSR is loaded and removed in a procedure that is
  153.    executed from CwithinB InContext.  This means the TSR occupies memory
  154.    only when it is actually in use.  If it were invoked CoutsideB InContext,
  155.    it would occupy memory all the time.  TSR's can be invoked from within
  156.    InContext if they are capable of being turned off (as by "menu off"
  157.    above) and sometimes even if they aren't.  This is possible because
  158.    InContext uses memory swapping and contains some interrupt-vector
  159.    protection.  This capability is not guaranteed, but you can try it for
  160.    any TSR you happen to use to see if it works.
  161. mub
  162.  Usage Example B: Phone List
  163.  
  164.  
  165.               E╔════════════════════════════════════════════════╗
  166.               E║       CUsage Example B: Document ArchiveE        ║
  167.               E╚════════════════════════════════════════════════╝
  168.  
  169.  
  170.    A very handy facility to have is a document archive, which can be
  171.    rapidly accessed from any work context.  One possible use for such an
  172.    archive is to hold on-disk software documentation (user manuals), but
  173.    other uses will be discussed below.
  174.  
  175.  CA Simple Approach
  176.  
  177.    This can be easily accomplished by:
  178.  
  179.       CB  Placing the documents in a compressed "archive" file, using the
  180.          LHA program.  This can be done manually, or in a more automated
  181.          way discussed below.
  182.  
  183.       CB  Creating a "Do" procedure that views the archive.
  184.  
  185.    Suppose, for example, you have a collection of software manuals (examples
  186.    which you certainly do have are INCONTXT.DOC and LHA.DOC).  You might
  187.    create a document directory, such as C:\DOCS, and place these manuals
  188.    there.  Then go to that directory and archive each one (select F ADction B
  189.    and "Archive").  When asked what archive, respond "DOCUMENT".  These steps
  190.    will result in the creation of a single file which contains, in highly
  191.    compressed form, the text of your software manuals.  The name of the file
  192.    is DOCUMENT.LZH.  When you are comfortable that this has been done
  193.    correctly, you should delete the original documents, retaining only the
  194.    archive.
  195.  
  196.    Now create a new Do procedure, perhaps called "Document".  Give it a
  197.    Description such as "View Document Archive".  For the procedure
  198.    definition, use the following:
  199.  
  200.       !viewLZH c:\docs\document.lzh
  201.  
  202.    Whenever you select this procedure (by typing "DD" for "Do", "Document"),
  203.    the internal LHA viewer will be invoked on the document archive.  You
  204.    will be able to select the desired document and view it, extract it, or
  205.    several other choices.  If you extract it, a copy of the original document
  206.    will be placed in the directory in which you are currently working.
  207.  
  208.  CHandling Multiple Archives
  209.  
  210.    It is easy to extend this to handle multiple archives, by just adding a
  211.    menu to the definition of the Do procedure.  A simple example is:
  212.  
  213.       !menu "Which archive would you like to view?"
  214.          !choice "Document"
  215.             !viewLZH c:\docs\document.lzh
  216.          !choice "Letters"
  217.             !viewLZH c:\personal\letters.lzh
  218.       !endMenu
  219.  
  220.    This example assumes two archives, one containing documents and the other
  221.    an archive of correspondence.  A correspondence archive might be handy if
  222.    you write letters from different work contexts, and want to be able to
  223.    keep them all in one place.  Note, however, that there is no protection
  224.    here against inadvertently using the same name for two letters, and thus
  225.    losing the older one.  You would need to check for duplication of names
  226.    yourself, before adding a new letter to the archive.
  227.  
  228.    This approach is especially convenient when you want to write a new letter
  229.    that is similar to one you wrote before.  Simply view the Letters archive,
  230.    select the older letter, and extract it.  A copy of it will now be in the
  231.    current directory.  Rename it and edit it, and you have the new letter.
  232.  
  233.  CAutomatic Archiving by Class
  234.  
  235.    If you have a document archive in which new material is added often, such
  236.    as a correspondence archive, you may want to make the addition of such
  237.    material more automatic.  One way of doing this is to redefine the
  238.    "Archive" action for a particular class.  Thus, the Archive action for
  239.    the "ltr" class might have the following procedure definition:
  240.  
  241.       lha u c:\personal\letters %f
  242.       !pause
  243.       !delete
  244.       
  245.    Anytime this archive action is executed, the selected "ltr" object will
  246.    be added to the letters archive without prompting the user for the archive
  247.    name.
  248.  
  249.    If you have several different object classes, all of which are letters,
  250.    you might make the above procedure a macro ("arcLtr", for example), and
  251.    use the macro to define the "Archive" action for each of the classes.
  252.    You might, for example, have both a personal and a business letter class
  253.    with different letterhead.
  254.  
  255.  CSaving to Desired Archive by Menu Selection
  256.  
  257.    An alternative approach is to redefine the common archive action (i.e.,
  258.    the "Archive" action in the "Common" action list), so that its procedure
  259.    presents you with a choice of destination.  The procedure definition might
  260.    be:
  261.  
  262.       !menu "In which archive should object '%f' be placed?"
  263.          !choice "Document"
  264.             lha u c:\docs\document %f
  265.          !choice "Letters"
  266.             lha u c:\personal\letters %f
  267.             !choice "Other"
  268.             !query 1 "Enter name of LHA archive" 12
  269.             !verify "OK to archive '%f' to '%1'?"
  270.          lha u %1 %f
  271.       !endMenu
  272.       !pause
  273.       !delete
  274.  
  275.    As you can see, lots of variations are possible.  You should be able to
  276.    adapt these ideas to your own situation.
  277. muc
  278.  Usage Example C: Phone List
  279.  
  280.  
  281.               E╔════════════════════════════════════════════════╗
  282.               E║          CUsage Example C: Phone ListE           ║
  283.               E╚════════════════════════════════════════════════╝
  284.  
  285.  
  286.    If you keep your phone list on a computer, you're well aware that you
  287.    may have to consult it at any time, and from anywhere.  The "Do" Command
  288.    exists for such cases.  When you select a procedure from the Do list,
  289.    it is executed regardless of your current spatial context.
  290.  
  291.  CA Simple Approach
  292.  
  293.    A simple approach is to define a Do procedure (call it "Phones", for
  294.    example) which invokes the internal editor on the file in which you keep
  295.    your phone numbers.  If your phone list file is "c:\personal\phones.txt",
  296.    then the definition of the "Phones" procedure might be:
  297.  
  298.       !edit c:\personal\phones.txt
  299.  
  300.    Whenever you now select "Do" and "Phones" (by typing "DP", for example),
  301.    you'll find yourself editing the phone list.  When you finish, you will
  302.    still be in the work context you were in before the Do command.
  303.  
  304.  CSearching the Phone List
  305.  
  306.    Once you're editing the phone list, you can type Alt-S to search for a
  307.    particular name.  If you do this often, you might want to expand the
  308.    "Phones" procedure as follows:
  309.  
  310.       !keyStuff "\@S"
  311.       !edit c:\personal\phones.txt
  312.  
  313.    This simply automates the selection of the editor's @Search command, so
  314.    that you are immediately presented with an "Enter search string" query.
  315.    It does this by using the internal CkeyStuffB command to pre-load the
  316.    keyboard buffer with the Alt-S character, as if you had typed it
  317.    yourself.
  318. mud
  319.  Usage Example D: Object Deletion
  320.  
  321.  
  322.               E╔════════════════════════════════════════════════╗
  323.               E║       CUsage Example D: Object DeletionE         ║
  324.               E╚════════════════════════════════════════════════╝
  325.  
  326.  
  327.    Different users have different preferred approaches to the deletion of
  328.    files.  Experienced users may prefer immediate deletion with, perhaps,
  329.    only a single verification.  Other users may prefer a second verification
  330.    before such a drastic action.  Many users may prefer that deleted material
  331.    be placed in a holding area from which recovery is possible, if desired.
  332.    All of these behaviors are readily achievable with InContext.
  333.  
  334.    Deletion of individual objects is controlled by the procedure used to
  335.    define the "Delete" action in the "Common" action list.  Deletion of
  336.    groups of objects (a whole class, a whole view, or all the files in the
  337.    current directory) is controlled by the definition of the "Del-all"
  338.    action in the "Group" action list.  The discussion below describes
  339.    various alternative forms that these procedure definitions might take,
  340.    in order to achieve various deletion behaviors.
  341.  
  342.  CThe Default Approach
  343.  
  344.    The default approach simply asks the user if it's OK to delete the object,
  345.    and deletes it if the reply is "Yes".  (Based on the setting of one of the
  346.    "Miscellaneous" options, there may be a second verification query before
  347.    deletion occurs.)
  348.  
  349.    This behavior is achieved, for individual objects, by the procedure:
  350.  
  351.         !delete
  352.  
  353.    and for groups of objects, by the procedure:
  354.  
  355.         !deleteGroup
  356.  
  357.    The individual-object deletion procedure might have been written in the
  358.    following way:
  359.  
  360.         !verify "OK to delete '%f'?"
  361.         !delete %f noquery
  362.  
  363.  CThe "Hair Trigger" Approach
  364.  
  365.    As they say in the TV commercials, DON'T TRY THIS AT HOME!  However, just
  366.    for the sake of completeness, please note that the procedure:
  367.  
  368.         !delete noquery
  369.  
  370.    would produce immediate, irrevocable deletions without querying the user.
  371.  
  372.    Similarly, the procedure
  373.  
  374.         !forEachObject
  375.            !delete %F noquery
  376.         !endFor
  377.  
  378.    would immediately delete a whole group of objects.  It is unlikely that
  379.    anyone would actually want to use these particular definitions, but it
  380.    is instructive to look at them.
  381.  
  382.  CUsing a Trash Can
  383.  
  384.    A more likely alternative to the default behavior is the incorporation
  385.    of a "trash-can" directory.  The idea here is that deleted material is
  386.    not actually immediately removed from the disk.  Instead, it is simply
  387.    moved to a holding area (e.g., "C\JUNK").  This means that you can
  388.    recover such material, even after the deletion, provided you have taken
  389.    no action, in the meantime, to delete it from the holding area.
  390.  
  391.    To achieve this behavior for the deletion of individual files, create a
  392.    "trash-can" directory, such as C\JUNK, and change the procedure for the
  393.    "Delete" action (in the "Common" action list) to:
  394.  
  395.         !verify "OK to delete '%f'?"
  396.         !rename %f c:\junk\%f
  397.  
  398.    This will cause the object to be moved to the C:\JUNK directory after the
  399.    user verifies his intention to delete.  The analogous procedure for the
  400.    "Group" action list is:
  401.  
  402.         !verify "OK to delete these objects?"
  403.         !forEachObject
  404.            !rename %F c:\junk\%F
  405.         !endFor
  406.  
  407.    Each of these procedures will result in movement of the selected objects
  408.    to the C:\JUNK directory if there is not already an object of the same
  409.    name in that directory.  If there is, the user will be asked if it's OK
  410.    to replace the object that's already in the C:\JUNK directory.  A "No"
  411.    answer here would terminate the deletion action.
  412.  
  413.    If you don't want to be asked about such replacement, the word "noquery"
  414.    can be added to each of the "rename" commands just above.  For example,
  415.    the procedure for individual objects becomes:
  416.  
  417.         !verify "OK to delete '%f'?"
  418.         !rename %f c:\junk\%f noquery
  419.  
  420.    With this procedure, the user won't be asked before old objects in the
  421.    JUNK directory are replaced by more recent deletions.  This means that
  422.    only the last object of a given filename will be kept.
  423.  
  424.    With any of these procedures, the deleted object can be recovered by
  425.    going to the JUNK directory, selecting the object, selecting the "Take"
  426.    action, and carrying the object back to the desired directory.
  427.  
  428.    These procedure definitions allow objects to be deleted from anywhere
  429.    CexceptB the JUNK directory itself.  For that, it's probably best to
  430.    define a "Do" procedure (perhaps called "Cleanup") such as:
  431.  
  432.         !verify "OK to empty JUNK directory?"
  433.         del c:\junk
  434.         !relogDir c:\junk
  435. mue
  436.  Usage Example E: Installing a Print Spooler
  437.  
  438.  
  439.               E╔════════════════════════════════════════════════╗
  440.               E║  CUsage Example E: Installing a Print SpoolerE   ║
  441.               E╚════════════════════════════════════════════════╝
  442.  
  443.  
  444.    The print action used as a default by InContext has the following rather
  445.    primitive procedure definition:
  446.  
  447.         copy %f prn:
  448.         echo   >prn:
  449.  
  450.    This procedure uses a DOS copy command to copy the to-be-printed file to
  451.    the standard printer output defined for your system (usually LPT1).  After
  452.    the file has been copied to the printer, a page-eject character is sent,
  453.    using the DOS "echo" command.  (The funny-looking character ( ) is
  454.    Control-L, which is the normal page-eject character.)
  455.  
  456.    This is used as the default print procedure because the successful use of
  457.    a print spooler (such as the DOS "PRINT" command) takes a little bit of
  458.    setting up.  This would be true for the use of a print spooler from inside
  459.    CanyB DOS shell.
  460.  
  461.    A print spooler is a program that prints files in the "background", while
  462.    other work goes on in the foreground.  Its advantage is that you can go on
  463.    working while your printer prints.  Without a print spooler, you must wait
  464.    for the entire print operation to be completed before your computer again
  465.    becomes available for other work.  Since spoolers avoid this waiting, you
  466.    may want to set up your system so that printing occurs via a spooler.
  467.  
  468.    The problem with print spoolers is that they are "Terminate-and-Stay-
  469.    Resident" programs (TSR's).  The first time you invoke the DOS "PRINT"
  470.    command, for example, it loads a print spooler into memory, where it is
  471.    intended to remain until you turn off or reboot your computer.
  472.  
  473.    Many TSR's can be invoked from CwithinB InContext, without any
  474.    difficulties.  For example, a mouse menu driver might be loaded any time
  475.    you invoke your editor, so that an "edit" procedure might look like this:
  476.  
  477.         menu myedit
  478.         myeditor %f
  479.         menu off
  480.  
  481.    With this arrangement, the "menu" program, a TSR, would be loaded into
  482.    a portion of the memory freed when InContext "swaps out".  The TSR would
  483.    be in memory and active while the "myeditor" program is operating, but
  484.    would be unloaded from memory before returning.  When InContext regains
  485.    control, things would be as if the TSR had never been loaded.  (This does
  486.    not work for all TSR's.)
  487.  
  488.    The problem with print spoolers is that you want them to be resident in
  489.    memory CwhileB InContext is operating, and not just when InContext has
  490.    invoked some other program.  That means that the TSR must be loaded CbeforeB
  491.    InContext is invoked.  Thus, the procedure for setting up your system to
  492.    use the DOS "PRINT" command and its associated print spooler is:
  493.  
  494.       CB  Add the command "PRINT" to your AUTOEXEC.BAT file.  This causes
  495.          the resident portion of the DOS print spooler to be loaded into
  496.          memory, and to remain there.
  497.  
  498.       CB  Change the definitions of the "printTxt" macro and the
  499.          "incPrint" macro to:
  500.  
  501.               print %f
  502.  
  503.          This will cause the DOS print command to be used for each print
  504.          operation.
  505.  
  506.    Similar procedures should work for other print spoolers.
  507.